<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="__STATIC__/js/jquery.js"></script>
    <script src="__STATIC__/layui/layui.js"></script>
    <script src="__STATIC__/bootstrap-table/js/bootstrap-table.js"></script>
    <script src="__STATIC__/bootstrap-table/js/bootstrap-table-zh-CN.min.js"></script>
    <script src="__STATIC__/bootstrap-table/js/dropdown.js"></script>
    <link rel="stylesheet" href="__STATIC__/bootstrap-table/css/bootstrap-table.min.css">
    <link rel="stylesheet" href="__STATIC__/bootstrap-table/css/bootstrap.css">
    <script type="text/javascript" src="__STATIC__/x-admin/js/xadmin.js"></script>
    <link rel="stylesheet" href="__STATIC__/x-admin/css/font.css">
    <link rel="stylesheet" href="__STATIC__/x-admin/css/xadmin.css">
</head>
<body>
<a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新">
    <i class="layui-icon" style="line-height:30px">ဂ</i></a>
<table class="layui-table">
    <colgroup>
        <col width="150">
        <col width="200">
        <col>
    </colgroup>
    <thead>
    <tr>
        <th>视频名</th>
        <th>视频介绍</th>
        <th>视频连接</th>
        <th>视频封面</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody lay-size="sm">
    {foreach $result as $val}
    <input type="text" value="{$val.id}" id="id" hidden>
    <tr>
        <td>{$val.zjtitle}</td>
        <td>
            {$val.content}
        </td>
        <td>
            <video src="{$val.url}" controls="controls" style="width:200px;height: 150px">
            </video>
        </td>
        <td>
            <img src="{$val.icon_path}">
        </td>
        <td>
            <button class="layui-btn" name="video" value="{$val.id}">编辑视频</button>
        </td>
    </tr>
    {/foreach}
    </tbody>
    <button id="video" class="layui-btn layui-btn-lg layui-btn-normal" value="{$message.id}">添加视频</button>
</table>
</body>
</html>
<script>
    //编辑视频
    $("button[name=video]").click(function(){
        var id = $(this).val();
        window.location.href ="{:url('/video/upSection')}?id="+id;
    })
    //添加视频
    $("#video").click(function () {
        var id = $(this).val();
        window.location.href ="{:url('/video/addSectionVideo')}?id="+id;
    })
</script>